#ifndef GAMEMANAGER_HH
#define GAMEMANAGER_HH

#include "Character.hh"
#include <vector>
#include <memory>

class Dungeon;

class GameManager {
public:
    GameManager();                                     // Constructor
    GameManager(const GameManager&) = delete;          // Disable copy constructor
    GameManager& operator=(const GameManager&) = delete; // Disable copy assignment
    ~GameManager();                                    // Destructor

    void run();                                        // Main game loop

private:
    void showWelcomeScreen();                          // Show welcome screen
    void showMainMenu();                               // Display main menu
    void handleMenuChoice(int choice);                 // Handle user menu choice
    void startGame();                                  // Start new game
    void enterDungeon();                               // Enter dungeon
    void selectCharacter();                            // Character selection screen
    void waitForKey();                                 // Wait for user input
    int getValidInput(int min, int max);               // Input validation

    bool running;                                      // Game running state
    std::unique_ptr<Character> player;                 // Current player
    std::vector<std::unique_ptr<Character>> availableCharacters; // Character selection pool
    std::unique_ptr<Dungeon> currentDungeon;           // Current dungeon instance
};class GameManager {
public:
    GameManager();                                     // Constructor
    GameManager(const GameManager&) = delete;          // Disable copy constructor
    GameManager& operator=(const GameManager&) = delete; // Disable copy assignment
    ~GameManager();                                    // Destructor

    void run();                                        // Main game loop

private:
    void showWelcomeScreen();                          // Show welcome screen
    void showMainMenu();                               // Display main menu
    void handleMenuChoice(int choice);                 // Handle user menu choice
    void startGame();                                  // Start new game
    void enterDungeon();                               // Enter dungeon
    void selectCharacter();                            // Character selection screen
    void waitForKey();                                 // Wait for user input
    int getValidInput(int min, int max);               // Input validation

    bool running;                                      // Game running state
    std::unique_ptr<Character> player;                 // Current player
    std::vector<std::unique_ptr<Character>> availableCharacters; // Character selection pool
    std::unique_ptr<Dungeon> currentDungeon;           // Current dungeon instance
};

#endif // GAMEMANAGER_HH